package com.cskaoyan._05stringbuffer;

/**
 * @description:
 * @author: 景天
 * @date: 2023/2/16 11:46
 **/
/*
如果一个空字符串””,让其拼接10000次,效率怎么样?
 */
public class Demo {
    public static void main(String[] args) {
        String s = "";
        // 获取时间戳
        long start = System.currentTimeMillis();
        int sum=0;
        for (int i = 0; i <100000 ; i++) {
            // s += "a";
            // "a" aa aaa aaaa aaaaa
            sum += i;
        }
        // 获取时间戳
        long end = System.currentTimeMillis();
        System.out.println(end - start);


    }
}
